﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />


<!DOCTYPE html>
<html lang="zh-CN">
<head>

<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ihg-theme-draft">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>

  <div class="container-fluid ihg-container has-ihg-sidemenu">

    <div class="ihg-breadcrumb">
      <ol class="breadcrumb border-breadcrumb">
        <li class="active">Delegate &nbsp;&nbsp;-&nbsp;&nbsp;View</li>
      </ol>
    </div>

    <div class="ihg-content-layout">

      <div class="form-horizontal ihg-form form-personal-info">

        <div class="block-heading">
          <h5>Information</h5>
        </div>

        <div class="form-horizontal ihg-form form-personal-info">

          <div class="form-group ihg-form-group">
            <label class="control-label col-xs-3" style="width: 19%;">AVATAR：</label>
            <div class="col-xs-3">
              <p class="form-control-static"><img src="${delegate.avatar}" style="width:100px;height:100px;"></p>
            </div>
          </div>

          <div class="form-group ihg-form-group">
            <label class="control-label col-xs-3" style="width: 19%;">NAME：</label>
            <div class="col-xs-3">
              <p class="form-control-static">${delegate.name}</p>
            </div>
            <label class="control-label col-xs-3" style="width: 19%;">EMAIL ADDRESS：</label>
            <div class="col-xs-3">
              <p class="form-control-static">${delegate.email}</p>
            </div>
          </div>

          <div class="form-group ihg-form-group">
            <label class="control-label col-xs-3" style="width: 19%;">TELEPHONE：</label>
            <div class="col-xs-3">
              <p class="form-control-static">${delegate.telephone}</p>
            </div>
            <label class="control-label col-xs-3" style="width: 19%;">HOTEL NAME：</label>
            <div class="col-xs-3">
              <p class="form-control-static">${delegate.hotelName}</p>
            </div>
          </div>

          <div class="form-group ihg-form-group">
            <label class="control-label col-xs-3" style="width: 19%;">SUB-REGION：</label>
            <div class="col-xs-3">
              <p class="form-control-static">${delegate.subregion}</p>
            </div>
            <label class="control-label col-xs-3" style="width: 19%;">JOB TITLE：</label>
            <div class="col-xs-3">
              <p class="form-control-static">${delegate.jobTitle}</p>
            </div>
          </div>

          <div class="form-group ihg-form-group">
            <label class="control-label col-xs-3" style="width: 19%;">Line Manager：</label>
            <div class="col-xs-3">
              <p class="form-control-static">${delegate.reportTo}</p>
            </div>
            <label class="control-label col-xs-3" style="width: 19%;">Coach：</label>
            <div class="col-xs-3">
              <p class="form-control-static">${delegate.coach}</p>
            </div>
          </div>

        </div>

        <div class="block-heading">
          <h5>Session Information</h5>
        </div>

        <div class="form-horizontal ihg-form form-personal-info">
          <div class="form-group ihg-form-group">
            <label class="control-label col-xs-3" style="width: 19%;">Session Name：</label>
            <div class="col-xs-3">
              <p class="form-control-static">${session.name}</p>
            </div>
            <label class="control-label col-xs-3" style="width: 19%;">Session Time：</label>
            <div class="col-xs-3">
              <p class="form-control-static"><fmt:formatDate value="${session.startDate}" pattern="yyyy-MM-dd"/>&nbsp;&nbsp;-&nbsp;&nbsp;<fmt:formatDate value="${session.endDate}" pattern="yyyy-MM-dd"/></p>
            </div>
          </div>
          <div class="form-group ihg-form-group">
            <label class="control-label col-xs-3" style="width: 19%;">Session PHASE：</label>
            <div class="col-xs-3">
              <p class="form-control-static"><label class="label label-${session.sessionPhase.css}">${session.sessionPhase.display}</label></p>
            </div>
            <label class="control-label col-xs-3" style="width: 19%;">Lead Assessor：</label>
            <div class="col-xs-3">
              <p class="form-control-static">${participator.assessorName}</p>
            </div>
          </div>
        </div>

        <div class="block-heading">
          <h5>Reports And Records</h5>
        </div>
        <div class="form-horizontal ihg-form form-personal-info">
          <div class="form-group ihg-form-group">
            <label class="control-label col-xs-3" style="width: 19%;">Reports For Delegate：</label>
            <div class="col-xs-3">
              <p class="form-control-static"><a href="${(not empty sessionReport and not empty sessionReport.delegateFinalReport) ? sessionReport.delegateFinalReport : 'javascript:void(0);'}" download="delegate_report.zip">下载</a></p>
            </div>
            <label class="control-label col-xs-3" style="width: 19%;">Reports For Coach/Line Manager：</label>
            <div class="col-xs-3">
              <p class="form-control-static"><a href="${(not empty sessionReport and not empty sessionReport.managerFinalReport) ? sessionReport.managerFinalReport : 'javascript:void(0);'}" download="manager_report.pdf">下载</a></p>
            </div>
          </div>
          <div class="form-group ihg-form-group">
            <label class="control-label col-xs-3" style="width: 19%;">Reports For PPL：</label>
            <div class="col-xs-3">
              <p class="form-control-static"><a href="${(not empty sessionReport and not empty sessionReport.peoplePlaningFinalReport) ? sessionReport.peoplePlaningFinalReport : 'javascript:void(0);'}" download="ppl_report.pdf">下载</a></p>
            </div>
          </div>
        </div>

        <c:if test="${session.sessionPhase.after}">
          <div class="block-heading">
            <h5>Coaching Records</h5>
          </div>
          <table class="table table-striped ihg-table tab-pane">
            <thead>
              <tr>
                <th>序号</th>
                <th>会话时间</th>
                <th>最近更新</th>
                <th>状态</th>
              </tr>
            </thead>
            <tbody>
              <c:forEach var="conversation" items="${conversations}" varStatus="status">
                <tr>
                  <td>${status.index + 1}</td>
                  <td><fmt:formatDate value="${conversation.conversationDate}" pattern="yyyy-MM-dd"/></td>
                  <td><fmt:formatDate value="${conversation.lastUpdateTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                  <td>
                    <label class="label label-${conversation.status.notSubmited ? 'default' : conversation.status.confirmed ? 'success' : 'danger'}" style="display: block; margin: 0 auto; width: 170px;"><fmt:message key="${conversation.status.message}" /></label>
                  </td>
                </tr>
              </c:forEach>
            </tbody>
          </table>
        </c:if>
        
        <c:if test="${not empty sessionCalibration || not empty reportWriting}">
          <div class="block-heading">
            <h5>Readness Recommendation</h5>
          </div>
          <table class="table table-striped ihg-table tab-pane">
            <thead>
              <tr>
                <th>Read Time</th>
                <th>Comments</th>
              </tr>
            </thead>
            <tbody>
              <c:choose>
                <c:when test="${not empty reportWriting}">
                  <tr>
                    <td>${reportWriting.sessionReportRecommendation.simpleHotelResult.cnMessage}</td>
                    <td>${reportWriting.sessionReportRecommendation.commentCn}</td>
                  </tr>
                </c:when>
                <c:otherwise>
                  <tr>
                    <td>${recommendation.simpleHotelResult.cnMessage}</td>
                    <td>${recommendation.comment}</td>
                  </tr>
                </c:otherwise>
              </c:choose>
            </tbody>
          </table>
        </c:if>

      </div>
    </div>
  </div>

  <%@ include file="/WEB-INF/include/script.jsp"%>

</body>
</html>